package com.edfu.core.testmgt.persistence.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.edfu.core.identitymgt.persistence.entity.UserEntity;

@Entity
@Table(name = "user_test_subscription")
public class UserTestSubscriptionEntity implements ITestMgtEntity {
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;
	
	@ManyToOne
	@JoinColumn(name = "user_id", nullable = false)
	private UserEntity user;
	
	@ManyToOne
	@JoinColumn(name = "test_id", nullable = false)
	private TestEntity test;
	
	private long subscribedDate;
	
	private long testDate;
	
	private boolean present;
	
	private double percentage;
	
	private boolean pass;
	
	private String grade;
	
	private boolean unsubscribe;
	
	private double marks;

	public long getId() {
		return id;
	}	
	public void setId(long id) {
		this.id = id;
	}

	public UserEntity getUser() {
		return user;
	}
	public void setUser(UserEntity user) {
		this.user = user;
	}

	public TestEntity getTest() {
		return test;
	}
	public void setTest(TestEntity test) {
		this.test = test;
	}

	public long getSubscribedDate() {
		return subscribedDate;
	}
	public void setSubscribedDate(long subscribedDate) {
		this.subscribedDate = subscribedDate;
	}

	public long getTestDate() {
		return testDate;
	}
	public void setTestDate(long testDate) {
		this.testDate = testDate;
	}

	public boolean isPresent() {
		return present;
	}
	public void setPresent(boolean present) {
		this.present = present;
	}

	public double getPercentage() {
		return percentage;
	}
	public void setPercentage(double percentage) {
		this.percentage = percentage;
	}

	public boolean isPass() {
		return pass;
	}
	public void setPass(boolean pass) {
		this.pass = pass;
	}

	public String getGrade() {
		return grade;
	}
	public void setGrade(String grade) {
		this.grade = grade;
	}
	
	public boolean isUnsubscribe() {
		return unsubscribe;
	}
	public void setUnsubscribe(boolean unsubscribe) {
		this.unsubscribe = unsubscribe;
	}
	
	public double getMarks() {
		return marks;
	}
	public void setMarks(double marks) {
		this.marks = marks;
	}
	
	@Override
	public String toString() {
		return "UserTestSubscriptionEntity [user=" + user + ", test=" + test
				+ "]";
	}

}
